package com.bytebuddytest.quickstart;

import net.bytebuddy.implementation.bind.annotation.AllArguments;
import net.bytebuddy.implementation.bind.annotation.Origin;
import net.bytebuddy.implementation.bind.annotation.RuntimeType;

import java.lang.reflect.Method;
import java.util.Arrays;

/**
 * @author yutianhong
 * @version 1.0
 * @since 2023/08/14 11:03:56
 */
public class GeneralInterceptor {
    @RuntimeType
    public Object intercept(@AllArguments Object[] allArguments,
                            @Origin Method method) {
        // intercept any method of any signature
        System.out.println("allArguments = " + Arrays.toString(allArguments));
        System.out.println("method = " + method);
        return null;
    }
}
